clearset mem 500000kcd "/users/florianhollenbach/Documents/Duke/Fall2010/Development/Replication"insheet using "/Users/florianhollenbach/Documents/Duke/Fall2010/Development/Replication/Reading_WritingTRY1.csv"by year (country), sort: gen countrycode = _ngen gdp_dem=loggdp*newd********replication ******** xtset countrycode yearreg primary loggdp newd gdp_dem africa ca me sa sea ee es weestimates store rep1reg primary loggdp newd gdp_dem africa ca me sa capsurp gambia if region==1 & japan==0estimates store rep2xtreg primary loggdp newd gdp_dem if year== 1960 | year==1965|year==1970 | year==1975 | year==1980 | year==1985, reestimates store rep3xtgls primary loggdp newd gdp_dem if year==1960 | year==1965 | year==1970 | year==1975 | year==1980 | year==1985, corr(ar1) forceestimates store rep4outreg2 [rep1 rep2 rep3 rep4] using replication, wordgen missing=0replace missing=1 if primary==.logit missing loggdp newd gdp_demestimates store missing1logit missing loggdp newd gdp_dem if region==1estimates store missing2logit missing loggdp newd gdp_dem if region==0estimates store missing3outreg2 [missing1 missing2 missing3] using missing, wordegen primarybw=mean(primary), by(countrycode)egen newdbw=mean(newd), by(countrycode)egen loggdpbw=mean(loggdp), by(countrycode)egen gdp_dembw=mean(gdp_dem), by(countrycode)egen capsurpbw=mean(capsurp), by(countrycode)gen primarywi=primary-primarybwgen newdwi=newd-newdbwgen loggdpwi=loggdp-loggdpbwgen gdp_demwi=gdp_dem-gdp_dembwgen capsurpwi=capsurp-capsurpbwxtreg primary newdbw newdwi loggdpbw loggdpwi gdp_dembw gdp_dembw, i(countrycode) mle estimates store mixed1xtreg primary newdbw newdwi loggdpbw loggdpwi gdp_dembw gdp_dembw capsurpbw, i(countrycode) mleestimates store mixed2xtreg primary newdbw newdwi loggdpbw loggdpwi gdp_dembw gdp_dembw if year== 1960 | year==1965|year==1970 | year==1975 | year==1980 | year==1985, i(countrycode) mleestimates store mixed3outreg2 [mixed1 mixed2 mixed3] using mixed, wordxtreg primary newdbw newdwi loggdpbw loggdpwi gdp_dembw gdp_dembw, i(countrycode) mle estimates store mixed1xtreg primary newdbw newdwi loggdpbw loggdpwi gdp_dembw gdp_dembw capsurpbw, i(countrycode) mleestimates store mixed2xtreg primary newdbw newdwi loggdpbw loggdpwi gdp_dembw gdp_dembw if year== 1960 | year==1965|year==1970 | year==1975 | year==1980 | year==1985, i(countrycode) mleestimates store mixed3outreg2 [mixed1 mixed2 mixed3] using mixed, wordxtreg primary newdbw newdwi loggdpbw loggdpwi gdp_dembw gdp_dembw if region==1, i(countrycode) mle estimates store mixed21xtreg primary newdbw newdwi loggdpbw loggdpwi gdp_dembw gdp_dembw capsurpbw if region==1, i(countrycode) mleestimates store mixed22xtreg primary newdbw newdwi loggdpbw loggdpwi gdp_dembw gdp_dembw if year== 1960 | year==1965|year==1970 | year==1975 | year==1980 | year==1985 & region==1, i(countrycode) mleestimates store mixed23outreg2 [mixed21 mixed22 mixed23] using mixedpoor, word********* cross sectional*********democracy mean****clearinsheet using "/Users/florianhollenbach/Documents/Duke/Fall2010/Development/Replication/Reading_WritingTRY1.csv"collapse (mean) primary-capsurp, by(country)reg primary newd loggdp nwdgdp africa ca me saestimates store collapsed1reg primary newd loggdp nwdgdp africa ca me sa capsurp estimates store collapsed12outreg2 [collapsed1 collapsed12] using collapsedmean, word********* cross sectional*********democracy min****clearinsheet using "/Users/florianhollenbach/Documents/Duke/Fall2010/Development/Replication/Reading_WritingTRY1.csv"collapse (min) newd (mean) primary loggdp  africa ca me sa gambia region capsurp, by(country)gen interaction=newd*loggdpreg primary newd loggdp interaction africa ca me saestimates store collapse2reg primary newd loggdp interaction africa ca me sa capsurp estimates store collapse21outreg2 [collapse2 collapse21] using collapsemin, wordclear***********new data from the wold bank, michael ross and Quality of gov't dataset*******clearset mem 500000kcd "/users/florianhollenbach/Documents/Duke/Fall2010/Development/Replication"use "/Users/florianhollenbach/Documents/Duke/Fall2010/Development/Replication/new_data1.dta"drop if year>2007drop if year<1980gen loggdp=ln(gdppc)gen interaction=loggdp*democgen rossoil=.replace rossoil=(oil_prod32_05*oil_price_const_brlBP)/(mad_pop*1000)gen oildum=0replace oildum=1 if rossoil>=100 replace oildum=0 if rossoil==.drop countrycodeby year (wb_code), sort: gen countrycode = _nxtset countrycode yearegen primarynetbw=mean(primarynet), by(countrycode)egen primaryrossbw=mean(primarygross), by(countrycode)egen democbw=mean(democ), by(countrycode)egen loggdpbw=mean(loggdp), by(countrycode)egen interactionbw=mean(interaction), by(countrycode)egen oildumbw=mean(oildum), by(countrycode)egen netAidbw=mean(netAid), by(countrycode)gen democwi=democ-democbwgen primarynetwi=primarynet-primarynetbwgen primarygrosswi=primarygross-primarynetbwgen loggdpwi=loggdp-loggdpbwgen interactionwi=interaction-interactionbwgen oildumwi=oildum-oildumbwgen netAidwi=netAid-netAidbwsave "/Users/florianhollenbach/Documents/Duke/Fall2010/Development/Replication/new_data1save.dta", replacextreg  primarygross democbw democwi loggdpbw loggdpwi interactionbw interactionwi, i(countrycode) mlextreg primarygross democbw democwi loggdpbw loggdpwi interactionbw interactionwi oildumbw oildumwi, i(countrycode) mlextreg primarygross democbw democwi loggdpbw loggdpwi interactionbw interactionwi netAidbw netAidwi, i(countrycode) mlextreg primarynet democbw democwi loggdpbw loggdpwi interactionbw interactionwi, i(countrycode) mleestimates store new1	xtreg primarynet democbw democwi loggdpbw loggdpwi interactionbw interactionwi oildumbw oildumwi, i(countrycode) mleestimates store new2xtreg primarynet democbw democwi loggdpbw loggdpwi interactionbw interactionwi netAidbw netAidwi, i(countrycode) mleestimates store new3outreg2 [new1 new2 new3] using new, wordxtreg primarynet democbw democwi loggdpbw loggdpwi interactionbw interactionwi oildumbw oildumwi netAidbw netAidwi  , i(countrycode) mlegen lagprimarynetwi=l.primarynetwigen lagprimarygrossbw=l.primarygrosswixtreg primarynet lagprimarynetwi democbw democwi loggdpbw loggdpwi interactionbw interactionwi oildumbw oildumwi netAidbw netAidwi  , i(countrycode) mlextreg primarygross lagprimarygross democbw democwi loggdpbw loggdpwi interactionbw interactionwi oildumbw oildumwi netAidbw netAidwi, i(countrycode) mlegen missing=0replace missing=1 if primarynet==.gen missing2=0replace missing2=1 if primarygross==.logit missing loggdp democ interactionlogit missing2 loggdp democ interaction********* cross sectional*********democracy mean****clearuse "/Users/florianhollenbach/Documents/Duke/Fall2010/Development/Replication/new_data1save.dta"drop cnamecollapse (mean) gdppc-oildum, by(wb_code)reg primarygross democ loggdp interactionestimates store collapsed1newreg primarygross democ loggdp interaction oildum estimates store collapsed12newoutreg2 [collapsed1new collapsed12new] using collapsedmeannew, wordreg primarynet democ loggdp interactionreg primarynet democ loggdp interaction oildum ********* cross sectional*********democracy min****clearuse "/Users/florianhollenbach/Documents/Duke/Fall2010/Development/Replication/new_data1save.dta"drop cnamecollapse (min) democ (mean) primarygross primarynet loggdp oildum netAid, by(wb_code)gen interaction=democ*loggdpreg primarygross democ loggdp interactionestimates store collapsed1minnewreg primarygross democ loggdp interaction oildum estimates store collapsed12minnewreg primarygross democ loggdp interaction oildum netAidoutreg2 [collapsed1minnew collapsed12minnew] using collapsedminnew, wordreg primarynet democ loggdp interactionreg primarynet democ loggdp interaction oildum reg primarynet democ loggdp interaction oildum netAid